// 泛型类
class cPerson<T> {
  // 静态成员不能使用泛型的类型参数。
  name: string;
  // static  add  :T
   age: T;
  constructor(name: string, age: T) {
    this.name = name;
    this.age = age;
  }
}
const ps = new cPerson("123", "25");




class GenericNumber<NumType> {
  zeroValue: NumType;
  add: (x: NumType, y: NumType) => NumType;
}

let myGenericNumber = new GenericNumber<number>();
myGenericNumber.zeroValue = 0;
myGenericNumber.add = function (x, y) {
  return x + y;
};

myGenericNumber.add(7, 9);
